<?php if(Yii::app()->user->isGuest) : ?>
 
<?php 
if($form->getErrors() != null) {
   $this->beginWidget('zii.widgets.jui.CJuiDialog', array());
   header('Location: index.php?r=site/Loginerror');
}else{
   $this->beginWidget('zii.widgets.jui.CJuiDialog', array(
     'id'=>'userloginwidget',
   		//'cssFile'=>'/css/logincss.css',
   		//'themeUrl' => Yii::app()->request->baseUrl,
   		//'theme' => "",
     'options'=>array(
         'title'=>'User Login',
         'autoOpen'=>false,
         'modal'=>true,
         'width'=>300,
         'resizable'=>false,
     ),
     'htmlOptions'=>array('class'=>'login_widget'),
   ));
}

?>
 
<?php echo CHtml::beginForm(Yii::app()->homeUrl); ?>
 
<?php echo CHtml::activeLabel($form,'username'); ?>
<?php echo CHtml::activeTextField($form,'username') ?>
 
<?php echo CHtml::activeLabel($form,'password'); ?>
<?php echo CHtml::activePasswordField($form,'password') ?>
 
<?php echo CHtml::activeCheckBox($form,'rememberMe'); ?>
<?php echo CHtml::activeLabel($form,'rememberMe'); ?>
<?php echo CHtml::hiddenField("test",'Login',array('value'=>-2)); ?> 
<?php echo CHtml::submitButton('Submit'); ?>

<?php echo CHtml::endForm(); ?>
		
 
<?php $this->endWidget('zii.widgets.jui.CJuiDialog'); ?>
<?php endif; ?>